3.388 \(\int \frac{(d+e x^r)^2 (a+b \log (c x^n))}{x^2} \, dx\)

Optimal. Leaf size=123 \[ -\frac{d^2 \left (a+b \log \left (c x^n\right )\right )}{x}-\frac{2 d e x^{r-1} \left (a+b \log \left (c x^n\right )\right )}{1-r}-\frac{e^2 x^{2 r-1} \left (a+b \log \left (c x^n\right )\right )}{1-2 r}-\frac{b d^2 n}{x}-\frac{2 b d e n x^{r-1}}{(1-r)^2}-\frac{b e^2 n x^{2 r-1}}{(1-2 r)^2} \]

[Out]

-((b*d^2*n)/x) - (2*b*d*e*n*x^(-1 + r))/(1 - r)^2 - (b*e^2*n*x^(-1 + 2*r))/(1 - 2*r)^2 - (d^2*(a + b*Log[c*x^n
]))/x - (2*d*e*x^(-1 + r)*(a + b*Log[c*x^n]))/(1 - r) - (e^2*x^(-1 + 2*r)*(a + b*Log[c*x^n]))/(1 - 2*r)

________________________________________________________________________________________

Rubi [A]  time = 0.166915, antiderivative size = 104, normalized size of antiderivative = 0.85, number of steps used = 3, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {270, 2334, 14} \[ -\left (\frac{d^2}{x}+\frac{2 d e x^{r-1}}{1-r}+\frac{e^2 x^{2 r-1}}{1-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{b d^2 n}{x}-\frac{2 b d e n x^{r-1}}{(1-r)^2}-\frac{b e^2 n x^{2 r-1}}{(1-2 r)^2} \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x^r)^2*(a + b*Log[c*x^n]))/x^2,x]

[Out]

-((b*d^2*n)/x) - (2*b*d*e*n*x^(-1 + r))/(1 - r)^2 - (b*e^2*n*x^(-1 + 2*r))/(1 - 2*r)^2 - (d^2/x + (2*d*e*x^(-1
 + r))/(1 - r) + (e^2*x^(-1 + 2*r))/(1 - 2*r))*(a + b*Log[c*x^n])

Rule 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]
] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int \frac{\left (d+e x^r\right )^2 \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx &=-\left (\frac{d^2}{x}+\frac{2 d e x^{-1+r}}{1-r}+\frac{e^2 x^{-1+2 r}}{1-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \frac{-d^2+\frac{2 d e x^r}{-1+r}+\frac{e^2 x^{2 r}}{-1+2 r}}{x^2} \, dx\\ &=-\left (\frac{d^2}{x}+\frac{2 d e x^{-1+r}}{1-r}+\frac{e^2 x^{-1+2 r}}{1-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \left (-\frac{d^2}{x^2}+\frac{2 d e x^{-2+r}}{-1+r}+\frac{e^2 x^{2 (-1+r)}}{-1+2 r}\right ) \, dx\\ &=-\frac{b d^2 n}{x}-\frac{2 b d e n x^{-1+r}}{(1-r)^2}-\frac{b e^2 n x^{-1+2 r}}{(1-2 r)^2}-\left (\frac{d^2}{x}+\frac{2 d e x^{-1+r}}{1-r}+\frac{e^2 x^{-1+2 r}}{1-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end{align*}

Mathematica [A]  time = 0.288323, size = 121, normalized size = 0.98 \[ \frac{a \left (-d^2+\frac{2 d e x^r}{r-1}+\frac{e^2 x^{2 r}}{2 r-1}\right )+b \log \left (c x^n\right ) \left (-d^2+\frac{2 d e x^r}{r-1}+\frac{e^2 x^{2 r}}{2 r-1}\right )+b n \left (-d^2-\frac{2 d e x^r}{(r-1)^2}-\frac{e^2 x^{2 r}}{(1-2 r)^2}\right )}{x} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x^r)^2*(a + b*Log[c*x^n]))/x^2,x]

[Out]

(b*n*(-d^2 - (2*d*e*x^r)/(-1 + r)^2 - (e^2*x^(2*r))/(1 - 2*r)^2) + a*(-d^2 + (2*d*e*x^r)/(-1 + r) + (e^2*x^(2*
r))/(-1 + 2*r)) + b*(-d^2 + (2*d*e*x^r)/(-1 + r) + (e^2*x^(2*r))/(-1 + 2*r))*Log[c*x^n])/x

________________________________________________________________________________________

Maple [C]  time = 0.23, size = 1927, normalized size = 15.7 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d+e*x^r)^2*(a+b*ln(c*x^n))/x^2,x)

[Out]

-b*(-e^2*(x^r)^2*r+2*d^2*r^2-4*d*e*x^r*r+e^2*(x^r)^2-3*d^2*r+2*d*e*x^r+d^2)/x/(-1+2*r)/(-1+r)*ln(x^n)-1/2*(8*b
*d^2*n*r^4-24*b*d^2*n*r^3+2*ln(c)*b*d^2+10*I*Pi*b*d*e*r*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^r+26*b*d^2*n*r^2
-12*b*d^2*n*r+8*I*Pi*b*d*e*r^3*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^r-4*a*e^2*r^3*(x^r)^2+10*a*e^2*r^2*(x^r)^
2+2*a*d^2+4*a*d*e*x^r-4*I*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gn(I*c)*(x^r)^2+4*I*Pi*b*e^2*r*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*(x^r)^2-4*I*Pi*b*d^2*
r^4*csgn(I*c*x^n)^3-I*Pi*b*e^2*csgn(I*c*x^n)^3*(x^r)^2+I*Pi*b*e^2*csgn(I*c*x^n)^2*csgn(I*c)*(x^r)^2+32*ln(c)*b
*d*e*r^2*x^r-20*ln(c)*b*d*e*r*x^r-16*ln(c)*b*d*e*r^3*x^r-6*I*Pi*b*d^2*r*csgn(I*x^n)*csgn(I*c*x^n)^2-6*I*Pi*b*d
^2*r*csgn(I*c*x^n)^2*csgn(I*c)-12*I*Pi*b*d^2*r^3*csgn(I*x^n)*csgn(I*c*x^n)^2-12*I*Pi*b*d^2*r^3*csgn(I*c*x^n)^2
*csgn(I*c)+4*I*Pi*b*e^2*r*csgn(I*c*x^n)^3*(x^r)^2-16*b*d*e*n*r*x^r+16*b*d*e*n*r^2*x^r+2*I*Pi*b*e^2*r^3*csgn(I*
c*x^n)^3*(x^r)^2+13*I*Pi*b*d^2*r^2*csgn(I*c*x^n)^2*csgn(I*c)-5*I*Pi*b*e^2*r^2*csgn(I*c*x^n)^3*(x^r)^2-16*I*Pi*
b*d*e*r^2*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^r)/(-1+2*r)^2/x/(-1+r)^2

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n))/x^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.36923, size = 1015, normalized size = 8.25 \begin{align*} -\frac{4 \,{\left (b d^{2} n + a d^{2}\right )} r^{4} + b d^{2} n - 12 \,{\left (b d^{2} n + a d^{2}\right )} r^{3} + a d^{2} + 13 \,{\left (b d^{2} n + a d^{2}\right )} r^{2} - 6 \,{\left (b d^{2} n + a d^{2}\right )} r -{\left (2 \, a e^{2} r^{3} - b e^{2} n - a e^{2} -{\left (b e^{2} n + 5 \, a e^{2}\right )} r^{2} + 2 \,{\left (b e^{2} n + 2 \, a e^{2}\right )} r +{\left (2 \, b e^{2} r^{3} - 5 \, b e^{2} r^{2} + 4 \, b e^{2} r - b e^{2}\right )} \log \left (c\right ) +{\left (2 \, b e^{2} n r^{3} - 5 \, b e^{2} n r^{2} + 4 \, b e^{2} n r - b e^{2} n\right )} \log \left (x\right )\right )} x^{2 \, r} - 2 \,{\left (4 \, a d e r^{3} - b d e n - a d e - 4 \,{\left (b d e n + 2 \, a d e\right )} r^{2} +{\left (4 \, b d e n + 5 \, a d e\right )} r +{\left (4 \, b d e r^{3} - 8 \, b d e r^{2} + 5 \, b d e r - b d e\right )} \log \left (c\right ) +{\left (4 \, b d e n r^{3} - 8 \, b d e n r^{2} + 5 \, b d e n r - b d e n\right )} \log \left (x\right )\right )} x^{r} +{\left (4 \, b d^{2} r^{4} - 12 \, b d^{2} r^{3} + 13 \, b d^{2} r^{2} - 6 \, b d^{2} r + b d^{2}\right )} \log \left (c\right ) +{\left (4 \, b d^{2} n r^{4} - 12 \, b d^{2} n r^{3} + 13 \, b d^{2} n r^{2} - 6 \, b d^{2} n r + b d^{2} n\right )} \log \left (x\right )}{{\left (4 \, r^{4} - 12 \, r^{3} + 13 \, r^{2} - 6 \, r + 1\right )} x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n))/x^2,x, algorithm="fricas")

[Out]

-(4*(b*d^2*n + a*d^2)*r^4 + b*d^2*n - 12*(b*d^2*n + a*d^2)*r^3 + a*d^2 + 13*(b*d^2*n + a*d^2)*r^2 - 6*(b*d^2*n
 + a*d^2)*r - (2*a*e^2*r^3 - b*e^2*n - a*e^2 - (b*e^2*n + 5*a*e^2)*r^2 + 2*(b*e^2*n + 2*a*e^2)*r + (2*b*e^2*r^
3 - 5*b*e^2*r^2 + 4*b*e^2*r - b*e^2)*log(c) + (2*b*e^2*n*r^3 - 5*b*e^2*n*r^2 + 4*b*e^2*n*r - b*e^2*n)*log(x))*
x^(2*r) - 2*(4*a*d*e*r^3 - b*d*e*n - a*d*e - 4*(b*d*e*n + 2*a*d*e)*r^2 + (4*b*d*e*n + 5*a*d*e)*r + (4*b*d*e*r^
3 - 8*b*d*e*r^2 + 5*b*d*e*r - b*d*e)*log(c) + (4*b*d*e*n*r^3 - 8*b*d*e*n*r^2 + 5*b*d*e*n*r - b*d*e*n)*log(x))*
x^r + (4*b*d^2*r^4 - 12*b*d^2*r^3 + 13*b*d^2*r^2 - 6*b*d^2*r + b*d^2)*log(c) + (4*b*d^2*n*r^4 - 12*b*d^2*n*r^3
 + 13*b*d^2*n*r^2 - 6*b*d^2*n*r + b*d^2*n)*log(x))/((4*r^4 - 12*r^3 + 13*r^2 - 6*r + 1)*x)

________________________________________________________________________________________

Sympy [A]  time = 32.1023, size = 204, normalized size = 1.66 \begin{align*} - \frac{a d^{2}}{x} + 2 a d e \left (\begin{cases} \frac{x^{r}}{r x - x} & \text{for}\: r \neq 1 \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) + a e^{2} \left (\begin{cases} \frac{x^{2 r}}{2 r x - x} & \text{for}\: r \neq \frac{1}{2} \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) - \frac{b d^{2} n}{x} - \frac{b d^{2} \log{\left (c x^{n} \right )}}{x} - 2 b d e n \left (\begin{cases} \frac{\begin{cases} \frac{x^{r}}{r x - x} & \text{for}\: r \neq 1 \\\log{\left (x \right )} & \text{otherwise} \end{cases}}{r - 1} & \text{for}\: r > -\infty \wedge r < \infty \wedge r \neq 1 \\\frac{\log{\left (x \right )}^{2}}{2} & \text{otherwise} \end{cases}\right ) + 2 b d e \left (\begin{cases} \frac{x^{r - 1}}{r - 1} & \text{for}\: r - 2 \neq -1 \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) \log{\left (c x^{n} \right )} - b e^{2} n \left (\begin{cases} \frac{\begin{cases} \frac{x^{2 r}}{2 r x - x} & \text{for}\: r \neq \frac{1}{2} \\\log{\left (x \right )} & \text{otherwise} \end{cases}}{2 r - 1} & \text{for}\: r > -\infty \wedge r < \infty \wedge r \neq \frac{1}{2} \\\frac{\log{\left (x \right )}^{2}}{2} & \text{otherwise} \end{cases}\right ) + b e^{2} \left (\begin{cases} \frac{x^{2 r - 1}}{2 r - 1} & \text{for}\: 2 r - 2 \neq -1 \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) \log{\left (c x^{n} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x**r)**2*(a+b*ln(c*x**n))/x**2,x)

[Out]

-a*d**2/x + 2*a*d*e*Piecewise((x**r/(r*x - x), Ne(r, 1)), (log(x), True)) + a*e**2*Piecewise((x**(2*r)/(2*r*x
- x), Ne(r, 1/2)), (log(x), True)) - b*d**2*n/x - b*d**2*log(c*x**n)/x - 2*b*d*e*n*Piecewise((Piecewise((x**r/
(r*x - x), Ne(r, 1)), (log(x), True))/(r - 1), (r > -oo) & (r < oo) & Ne(r, 1)), (log(x)**2/2, True)) + 2*b*d*
e*Piecewise((x**(r - 1)/(r - 1), Ne(r - 2, -1)), (log(x), True))*log(c*x**n) - b*e**2*n*Piecewise((Piecewise((
x**(2*r)/(2*r*x - x), Ne(r, 1/2)), (log(x), True))/(2*r - 1), (r > -oo) & (r < oo) & Ne(r, 1/2)), (log(x)**2/2
, True)) + b*e**2*Piecewise((x**(2*r - 1)/(2*r - 1), Ne(2*r - 2, -1)), (log(x), True))*log(c*x**n)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (e x^{r} + d\right )}^{2}{\left (b \log \left (c x^{n}\right ) + a\right )}}{x^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n))/x^2,x, algorithm="giac")

[Out]

integrate((e*x^r + d)^2*(b*log(c*x^n) + a)/x^2, x)